package com.hwx.feign;

import com.hwx.pojo.Member;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "app-hwx-member",fallbackFactory = IMemberFeignFalbackFactory.class)
public interface IMemberFeign {

/*    @RequestMapping("/getMember")
    public String getMember();*/

    /**
     * @RequestParam 此处加注解是因为跨到了另一个项目
     * @param id
     * @return
     */
    @RequestMapping("/getMemberById")
    public String getMemberById(@RequestParam Integer id);

    /**
     * @RequestBody 此处加注解是因为跨到了另一个项目
     * @param member
     */
    @RequestMapping("/addMember")
    public void addMember(@RequestBody Member member);

    @RequestMapping("/getMemberList")
    public List<Member> getMemberList();

    /**
     * 服务器熔断的测试方法
     * @param id
     * @return
     */
    @RequestMapping("/getMemberById2")
    public Member getMemberById2(@RequestParam Integer id);
}
